home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / fslcl.h < prev    next >
C/C++ Source or Header  |  1990-10-19  |  2KB  |  72 lines

  1. /*
  2.  * fslcl.h --
  3.  *
  4.  *    Definitions of the parameters required for Local Domain operations.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/kernel/fslcl/RCS/fslcl.h,v 9.5 90/10/19 15:46:15 mendel Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _FSLCL
  19. #define _FSLCL
  20.  
  21. #ifdef KERNEL
  22. #include <fscache.h>
  23. #include <fsio.h>
  24. #include <fsconsist.h>
  25. #include <fsioFile.h>
  26. #else
  27. #include <fs.h>
  28. #endif
  29.  
  30. /*
  31.  * A directory entry:  Note that this is compatible with 4.3BSD 'struct direct'
  32.  */
  33. typedef struct Fslcl_DirEntry {
  34.     int fileNumber;        /* Index of the file descriptor for the file. */
  35.     short recordLength;        /* How many bytes this directory entry is */
  36.     short nameLength;        /* The length of the name in bytes */
  37.     char fileName[FS_MAX_NAME_LENGTH+1];    /* The name itself */
  38. } Fslcl_DirEntry;
  39. /*
  40.  *    FSLCL_DIR_BLOCK_SIZE    Directory's grow in multiples of this constant,
  41.  *        and records within a directory don't cross directory blocks.
  42.  *    FSLCL_DIR_ENTRY_HEADER    The size of the header of a FslclDirEntry;
  43.  *    FSLCL_REC_LEN_GRAIN    The number of bytes in a directory record
  44.  *                are rounded up to a multiple of this constant.
  45.  */
  46. #define FSLCL_DIR_BLOCK_SIZE    512
  47. #define FSLCL_DIR_ENTRY_HEADER    (sizeof(int) + 2 * sizeof(short))
  48. #define FSLCL_REC_LEN_GRAIN    4
  49.  
  50. /*
  51.  * Fslcl_DirRecLength --
  52.  *    This computes the number of bytes needed for a directory entry.
  53.  *    The argument should be the return of the String_Length function,
  54.  *    ie, not include the terminating null in the count.
  55.  */
  56. #define Fslcl_DirRecLength(stringLength) \
  57.     (FSLCL_DIR_ENTRY_HEADER + \
  58.     ((stringLength / FSLCL_REC_LEN_GRAIN) + 1) * FSLCL_REC_LEN_GRAIN)
  59.  
  60. #ifdef KERNEL
  61. /*
  62.  * Misc. routines.
  63.  */
  64. extern void Fslcl_DomainInit _ARGS_((void));
  65. extern ReturnStatus Fslcl_DeleteFileDesc _ARGS_((Fsio_FileIOHandle *handlePtr));
  66. extern void Fslcl_NameInitializeOps _ARGS_((void));
  67. extern void Fslcl_NameHashInit _ARGS_((void));
  68.  
  69. #endif /* KERNEL */
  70.  
  71. #endif /* _FSLCL */
  72.